#include "stdafx.h"
#include "wf_fileopen.h"

#include "pf_graphic.h"



WF_FileOpen::WF_FileOpen(PF_Container& container,
                                     PF_GraphicView& graphicView)
        :PF_ActionInterface("File Open", container, graphicView) {}


QAction* WF_FileOpen::createGUIAction(LX_Define::ActionType /*type*/, QObject* parent) {
	// tr("Open Drawing")
	QAction* action = new QAction(tr("&Open..."), parent);
#if QT_VERSION >= 0x040600
        action->setIcon(QIcon::fromTheme("document-open", QIcon(":/actions/fileopen2.png")));
#else
        action->setIcon(QIcon(":/actions/fileopen2.png"));
#endif
        action->setShortcut(QKeySequence::Open);
    //action->zetStatusTip(tr("Opens an existing drawing"));
    return action;
}


void WF_FileOpen::trigger() {
    /*
    // Not supported currently
    PF_DEBUG->print("PF_ActionFileOpen::trigger");

    PF_String fileName; //= PF_DIALOGFACTORY->requestFileOpenDialog();
    if (graphic!=NULL && !fileName.isEmpty()) {
        graphic->open(fileName, );
}
    */
    finish();
}


void WF_FileOpen::init(int status) {
    PF_ActionInterface::init(status);
    trigger();
}

// EOF
